Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for docker-compose.yml files #1431

Closed

Conversation

pedropombeiro
Copy link

@pedropombeiro pedropombeiro commented Oct 6, 2019

This PR adds support for docker-compose.yml files in the docker package. The approach was to add additional handlers alongside docker/lib/dependabot/docker, i.e. docker/lib/dependabot/docker_compose.

To address the duplication of code resulting from identical logic in e.g. parsing Docker image names or computing resulting updates some shared logic was extracted to modules under docker/lib/dependabot/docker/utils, which then get pulled in as mixins. For tests, I've added e.g. docker/spec/dependabot/docker/common/shared_examples_for_docker_update_checkers.rb, since most of the code is exactly the same.

Suggestions are welcome, especially on:

  • the correct location for the docker_compose folder;
  • the best way to share common Docker logic between docker and docker_compose;
  • whether naming this as docker_compose is the right way. I see that some languages already support multiple package managers in Dependabot (e.g. go:dep and go:modules), so I'm wondering if this should be named docker:compose in this list. I'm trying to figure out where that is configured, just searching for go:modules doesn't yield results.

Closes #390

[dependabot-core-dev] ~/dependabot-core $ bin/dry-run.rb docker_compose buildkite/agent --dir .buildkite
warning: parser/current is loading parser/ruby26, which recognizes
warning: 2.6.5-compliant syntax, but you are running 2.6.2.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
=> fetching dependency files
=> dumping fetched dependency files: ./dry-run/buildkite/agent/.buildkite
=> parsing dependency files
=> updating 1 dependencies

=== golang (1.12)
 => checking for updates
 => latest version from registry is 1.13.1
 => latest resolvable version is 1.13.1
 => requirements to unlock: own
 => requirements update strategy: 
 => updating golang from 1.12 to 1.13.1

    ± docker-compose.yml
    ~~~
    5c5
    <     image: golang:1.12
    ---
    >     image: golang:1.13.1
    ~~~

@pedropombeiro pedropombeiro force-pushed the feature/docker_compose branch from eaa6500 to 1af89fb Compare October 6, 2019 13:24
@pedropombeiro pedropombeiro marked this pull request as ready for review October 6, 2019 13:26
@pedropombeiro pedropombeiro force-pushed the feature/docker_compose branch from 1af89fb to 3520c32 Compare October 6, 2019 14:01
pedropombeiro referenced this pull request in buildkite/agent Oct 6, 2019
It currently can't SHA-pin the docker-compose.yml `image` keys, so can't help us achieve reproducible builds (dependabot/dependabot-core#390)
@pedropombeiro pedropombeiro force-pushed the feature/docker_compose branch 2 times, most recently from 3f94bb6 to d2d3d5b Compare October 6, 2019 20:30
@toolmantim
Copy link

Thanks @pombeirp! Would love to see support for docker-compose.yml land ❤️

@pedropombeiro pedropombeiro force-pushed the feature/docker_compose branch 2 times, most recently from 1d4e71d to 2f787e7 Compare October 7, 2019 12:25
@pedropombeiro
Copy link
Author

pedropombeiro commented Oct 7, 2019

@feelepxyz Don't know what is happening but the tests show as failing in the PR (due to stuff unrelated to the PR).

@pedropombeiro pedropombeiro force-pushed the feature/docker_compose branch from 2f787e7 to 2b8f252 Compare October 7, 2019 13:53
@rebelagentm
Copy link
Contributor

@pombeirp @feelepxyz It looks like the tests are passing again.

@feelepxyz
Copy link
Contributor

@pombeirp thanks for the contribution! Just a heads up that I won't be able to get to this immediately but hopefully get some time in the next week or so to review it thoroughly to make sure we understand the changes and can maintain it going forward.

@pedropombeiro
Copy link
Author

@feelepxyz Sure, totally understand it, thanks for the transparency.

@pedropombeiro pedropombeiro force-pushed the feature/docker_compose branch 3 times, most recently from cf811ee to 92939a8 Compare October 12, 2019 17:17
@feelepxyz feelepxyz added the T: feature-request Requests for new features label Oct 23, 2019
@pedropombeiro pedropombeiro force-pushed the feature/docker_compose branch 6 times, most recently from 6e2a632 to 9d2938d Compare October 31, 2019 16:36
@badgerwithagun
Copy link

Looking forward to this

@ajcann
Copy link

ajcann commented Dec 16, 2019

Also looking forward to this getting in!

@erkannt
Copy link

erkannt commented Mar 10, 2020

@pedropombeiro Can you tell us why this PR was closed? Would love to use this.

@pedropombeiro
Copy link
Author

@erkannt There was no feedback from reviewers for about 4 months, and because I keep a widget of open PRs in VS Code, I decided to clean that up a bit.

@falkenhawk
Copy link

@erkannt There was no feedback from reviewers for about 4 months, and because I keep a widget of open PRs in VS Code, I decided to clean that up a bit.

😭

@lsh-0
Copy link

lsh-0 commented Mar 25, 2021

Think we can re-open this? Who do we have to prod to get some review feedback?

@bobvanderlinden
Copy link

@rebelagentm could you have a look again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: feature-request Requests for new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Docker compose files
10 participants